Fix API deleteTrafficType not filtering physical network#6510
Conversation
|
Kudos, SonarCloud Quality Gate passed! |
| final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create(); | ||
| sc.setParameters("trafficType", trafficType); | ||
| sc.setParameters("physicalNetworkId", physicalNetworkId); | ||
| sc.setParameters("physicalNetwork", physicalNetworkId); |
There was a problem hiding this comment.
this is strange, the field in both NetworkVO and in PhysicalNetworkTrafficType is called physicalNetworkId. I would say the new value is the typo. Do you know why this should work this way @GutoVeronezi ?
There was a problem hiding this comment.
@DaanHoogland, SearchCriteria works according the declaration of the field while creating the SearchBuilder. The field representing the physical network ID was declared as physicalNetwork:
Therefore, we need to use physicalNetwork in the SearchCriteria in order to add the validation to the where clause.
There was a problem hiding this comment.
yes, you are right, very confusing, but I shouldn´t rely on naming conventions ;)
|
@blueorangutan package |
|
@sureshanaparti a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result: ✖️ el7 ✔️ el8 ✔️ debian ✖️ suse15. SL-JID 3670 |
|
@blueorangutan package |
|
@sureshanaparti a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3673 |
|
@blueorangutan test |
|
@sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-4402)
|








Description
While deleting a traffic type, ACS validates if there is any VM related to it. However, if we have several physical networks containing a traffic type, ACS does not filter the physical network to do the validation. For instance, if we have two (2) physical networks containing the traffic type Guest, the first one having VMs related, and the second not having VMs related, if we try to remove the second traffic type, ACS give us the message
The Traffic Type is not deletable because there are existing networks with this traffic type:Guest.The API
deleteTrafficTypewas designed to filter the physical network where the traffic type is, however, due to a typo this filtering was not been applied correctly. This PR intends to fix this typo to honor the API behavior.Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
In an advanced zone I created 4 physical networks, one for each traffic type (Public, Guest, Management, Storage). I instantiated some VMs so they get guest IPs. In the Public physical network I added a Guest traffic type. I tried to remove the new Guest traffic type from Public physical network, which did not have any VMs related to it, and, before the changes, I was getting the message
The Traffic Type is not deletable because there are existing networks with this traffic type:Guest. After the changes, I could remove successfully the new Guest traffic type via API deleteTrafficType. I also tried to remove the Guest traffic type which had VMs related to it, however, as expected, I received theThe Traffic Type is not deletable...message.I also created a unit test to validate the data retrieving.